package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class HelloServiceImpl  implements HelloService {

    private Random random = new Random();


    @Override
    public String sayHelloOne(String name,int timeToWait) {
        int i = random.nextInt(101);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello1:"+name;
    }

    @Override
    public String sayHelloTwo(String name,int timeToWait) {
        int i = random.nextInt(101);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello2:"+name;
    }
}
